package com.mf.service;

import com.mf.entity.bo.BasicDataDictionaryBo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mf.entity.request.searchParams.SearchDictionaryRequest;
import com.mf.entity.vo.BasicDataDictionaryVo;

import java.util.List;
import java.util.Map;

/**
 * 数据字典 服务类
 *
 * @author mf
 * @since 2024-08-23
 */
public interface IBasicDataDictionaryService extends IService<BasicDataDictionaryBo> {
    /**
     * 查询字典（角色内可见数据）
     */
    List<BasicDataDictionaryVo> findDictByRoleIdList();

    /**
     * 删除字典
     */
    Integer deleteById(Integer id);

    /**
     * 查询字典
     */
    List<BasicDataDictionaryVo> listByDictionary(SearchDictionaryRequest searchDictRequest);

    /**
     * 根据code查询一层子数据
     */
    Map<String, List<BasicDataDictionaryVo>>  findByPidCode(String pidCode, Boolean isRole);

    /**
     * 根据id查询字典
     */
    BasicDataDictionaryBo getById(Integer id);

    /**
     * 验证字典编码是否重复
     */
    boolean findByCode(String code);

    /**
     * 新增|编辑数据字典
     */
    Integer insert(BasicDataDictionaryVo basicDataDictionaryVo);
}
